<template>
  <div class="box-border full" style="padding: 30px 20px;">
    <el-tabs v-model="activeName" class="shadow-tint full-height" >
      <!--<el-tab-pane label="批量导入" name="input">用户管理</el-tab-pane>-->
      <!--<el-tab-pane label="手动导入" name="form">配置管理</el-tab-pane>-->
      <el-tab-pane label="excel导入" name="excel">
        <excel-tab />
      </el-tab-pane>
      <el-tab-pane label="手动导入" name="person" >
        <div class="person">
          <edit-ques @on-save-ques="addQues" :key="id"></edit-ques>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import ExcelTab from './ExcelTab'
import EditQues from '../editQues/EditQues'
import api from '@/api'
export default {
  data () {
    return {
      id: 0,
      activeName: 'excel'
    }
  },
  components: {
    ExcelTab,
    EditQues
  },
  methods: {
    addQues (ques) {
      api.addQues(ques)
        .then(api.commonResp((success, msg) => {
          if (success) {
            this.$message('添加成功')
            this.id++
          } else {
            this.$message.error(msg)
          }
        }))
    }
  }
}
</script>

<style scoped lang="less">
  .person {
    height: 600px;
    overflow-x: hidden;
    overflow-y: scroll;
  }
</style>
